﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CarShop
{
    public class Bus : Vehicle, IDescriptive
    {
        //fields
        private Engine busEngine;
        private Transmission busTransmission;
        private byte possiblePassengers;
        private int busWeight;
        private List<string> busDescription = new List<string>();

        //constructor
        public Bus(string brand, string model, string color, int year, int speed, int price, Engine busEngine, Transmission busTransmission, byte possiblePassengers, int busWeight)
            : base(brand, model, color, year, speed, price)
        {
            this.busEngine = busEngine;
            this.busTransmission = busTransmission;
            this.possiblePassengers = possiblePassengers;
            this.busWeight = busWeight;
        }
        public Bus(string brand, string model, string color, int year, int speed, int price, Engine busEngine, Transmission busTransmission, byte possiblePassengers, int busWeight, List<string> busDescription)
            : this(brand, model, color, year, speed, price, busEngine, busTransmission, possiblePassengers, busWeight)
        {
            this.busDescription = busDescription;
        }


        //properties
        public Transmission BusTransmission
        {
            get
            {
                return this.busTransmission;
            }
            set
            {
                this.busTransmission = value;
            }
        }

        public Engine BusEngine
        {
            get
            {
                return this.busEngine;
            }
            set
            {
                this.busEngine = value;
            }
        }

        public byte PossiblePassengers
        {
            get
            {
                return this.possiblePassengers;
            }
            set
            {
                this.possiblePassengers = value;
            }
        }

        private int BusWeight
        {
            get
            {
                return this.busWeight;
            }
            set
            {
                this.busWeight = value;
            }
        }

        public List<string> Description
        {
            get { return busDescription; }
            set
            {
                this.busDescription = value;
            }
        }

        //methods
        public void AddComment(string extra)
        {
            this.busDescription.Add(extra);
        }

        public override string AdditionalInfo()
        {
            StringBuilder someBus = new StringBuilder();
            someBus.AppendLine("Possible number of passengers: " + this.PossiblePassengers.ToString());
            someBus.AppendLine("Bus weight : " + this.BusWeight.ToString());
            someBus.AppendLine("Transmission: " + this.BusTransmission.ToString());
            someBus.AppendLine(this.BusEngine.ToString());
            someBus.AppendLine("Extras :");
            foreach (var extra in busDescription)
            {
                someBus.Append(extra.ToString() + " ");
            }
            return someBus.ToString();
        }

    }
}
